package com.ckn.strategy;

import com.ckn.factory.PayFactory;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.stereotype.Component;

/**
 * @Author chenkangning
 * @Date 2024/6/14 10:15
 */
@Component
public class WeiXinPay implements PayHandler, InitializingBean {

    @Override
    public String doPay(String payCode) {
        System.out.println("使用微信支付");
        return "微信支付";
    }

    @Override
    public void afterPropertiesSet()  {
        PayFactory.register("weixin",this);
    }
}
